<?php
require "vendor/autoload.php";
$obj = new PDO("mysql:host=localhost;dbname=news",'root','root');
use QL\QueryList;
$res = array(
    'name'=>array('.XSB_CONT>.Top2>li>.title','text'),
    'pp'=>array('.XSB_CONT>.Top2>li>.sign','text'),
    'zuo'=>array('.XSB_CONT>.Top2>li>.click','text')
);
$url = "http://www.17k.com/man/";
$data = QueryList::Query($url,$res)->data;

foreach($data as $key =>$v) {
    $name = $v['name'];
    $photo = $v['photo'];
    $zuo = $v['zuo'];
    $sql = "insert into dian set name='{$name}',photo='{$photo}',zuo='{$zuo}'";
    $aa = $obj->exec($sql);
}